#include <iostream>
#include <limits.h>

using namespace std;

typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;

void pass(uchar* data){
	data[0] = 'c';
}

int main(int argc, char *argv[])
{
	uint seq = 4123456;
	uchar seqArr[4];
	seqArr[0] = (seq & 0x000000FF);
	seqArr[1] = ((seq & 0x0000FF00) >> 8);
	seqArr[2] = ((seq & 0x00FF0000) >> 16);
	seqArr[3] =	((seq & 0xFF000000) >> 24);
	cout << (uint)seqArr[0] << endl;
	cout << (uint)seqArr[1] << endl;
	cout << (uint)seqArr[2] << endl;
	cout << (uint)seqArr[3] << endl;
	uint decoded = (seqArr[3] << 24) + (seqArr[2] << 16) + (seqArr[1] << 8) + seqArr[0];
	pass(seqArr);
	cout << "After: " << seqArr[0] << endl;
	cout << decoded << endl;
	cout << seq << endl;
	cout << USHRT_MAX << endl;
	cout << CHAR_MAX << endl;
	
    return 0;
}
